VERSION 5.00
Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "crystl32.ocx"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form frmORD540 
   BackColor       =   &H00800000&
   Caption         =   "ORD540"
   ClientHeight    =   8595
   ClientLeft      =   270
   ClientTop       =   180
   ClientWidth     =   11505
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   ScaleHeight     =   8595
   ScaleWidth      =   11505
   Begin MSDataListLib.DataCombo cboELLTN 
      Bindings        =   "frmORD540.frx":0000
      Height          =   315
      Left            =   9495
      TabIndex        =   89
      Top             =   3825
      Visible         =   0   'False
      Width           =   1425
      _ExtentX        =   2514
      _ExtentY        =   556
      _Version        =   393216
      ListField       =   "ILLOT"
      Text            =   ""
   End
   Begin MSDataListLib.DataCombo cboELWHC 
      Bindings        =   "frmORD540.frx":0015
      Height          =   315
      Left            =   6015
      TabIndex        =   88
      Top             =   3825
      Visible         =   0   'False
      Width           =   2715
      _ExtentX        =   4789
      _ExtentY        =   556
      _Version        =   393216
      ListField       =   "WMDSC"
      BoundColumn     =   "WMWHC"
      Text            =   ""
   End
   Begin VB.TextBox txtELWHC 
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   7.5
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   288
      Left            =   6000
      TabIndex        =   87
      Top             =   3825
      Width           =   510
   End
   Begin VB.TextBox txtWMDSC 
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   7.5
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   288
      Left            =   6570
      Locked          =   -1  'True
      TabIndex        =   86
      Top             =   3825
      Width           =   2160
   End
   Begin VB.TextBox txtELLTN 
      Alignment       =   1  'Right Justify
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   7.5
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   288
      Left            =   9495
      TabIndex        =   85
      Top             =   3825
      Width           =   1155
   End
   Begin MSAdodcLib.Adodc Adodc9 
      Height          =   330
      Left            =   9705
      Top             =   -120
      Visible         =   0   'False
      Width           =   1665
      _ExtentX        =   2937
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "9.ILM"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSAdodcLib.Adodc Adodc8 
      Height          =   330
      Left            =   7440
      Top             =   -30
      Visible         =   0   'False
      Width           =   1935
      _ExtentX        =   3413
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "8.IWM"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin Crystal.CrystalReport CrystalReport1 
      Left            =   8385
      Top             =   8115
      _ExtentX        =   741
      _ExtentY        =   741
      _Version        =   348160
      PrintFileLinesPerPage=   60
   End
   Begin VB.CheckBox chkELBOD 
      BackColor       =   &H00E0E0E0&
      Caption         =   "Back Order"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00800080&
      Height          =   300
      Left            =   3180
      TabIndex        =   82
      Top             =   3420
      Width           =   1455
   End
   Begin VB.TextBox txtELBOQ 
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   7.5
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   288
      Left            =   2235
      TabIndex        =   81
      Top             =   15
      Visible         =   0   'False
      Width           =   990
   End
   Begin VB.TextBox txtELBOW 
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   7.5
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   288
      Left            =   6570
      TabIndex        =   80
      Top             =   -15
      Visible         =   0   'False
      Width           =   825
   End
   Begin VB.TextBox txtELPSQ 
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   7.5
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   288
      Left            =   3180
      TabIndex        =   79
      Top             =   4230
      Width           =   990
   End
   Begin VB.TextBox txtELPSW 
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   7.5
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   288
      Left            =   7275
      TabIndex        =   78
      Top             =   4290
      Width           =   840
   End
   Begin VB.TextBox txtEHAMT 
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   7.5
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   288
      Left            =   9870
      Locked          =   -1  'True
      TabIndex        =   67
      Top             =   7695
      Width           =   1455
   End
   Begin VB.TextBox txtEHVAM 
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   7.5
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   288
      Left            =   7395
      Locked          =   -1  'True
      TabIndex        =   66
      Top             =   7695
      Width           =   1185
   End
   Begin VB.TextBox txtEHBVA 
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   7.5
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   288
      Left            =   1770
      Locked          =   -1  'True
      TabIndex        =   65
      Top             =   7665
      Width           =   1110
   End
   Begin VB.TextBox txtEHBCA 
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   7.5
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   288
      Left            =   4275
      Locked          =   -1  'True
      TabIndex        =   64
      Top             =   7695
      Width           =   1455
   End
   Begin VB.Frame FrameECLine 
      BackColor       =   &H00E0E0E0&
      BorderStyle     =   0  'None
      Caption         =   "Frame1"
      Height          =   2235
      Left            =   120
      TabIndex        =   39
      Top             =   3360
      Width           =   11160
      Begin VB.TextBox txtELVAT 
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   9375
         TabIndex        =   74
         Top             =   1350
         Width           =   855
      End
      Begin MSDataListLib.DataCombo cboELITN 
         Bindings        =   "frmORD540.frx":002A
         Height          =   375
         Left            =   5895
         TabIndex        =   63
         Top             =   15
         Visible         =   0   'False
         Width           =   4005
         _ExtentX        =   7064
         _ExtentY        =   661
         _Version        =   393216
         ListField       =   "IMITD"
         BoundColumn     =   "IMITN"
         Text            =   ""
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "VNI-Times"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin VB.ComboBox cboELSTT 
         ForeColor       =   &H000000FF&
         Height          =   315
         ItemData        =   "frmORD540.frx":003F
         Left            =   9390
         List            =   "frmORD540.frx":0058
         TabIndex        =   52
         Top             =   1800
         Width           =   1500
      End
      Begin VB.TextBox txtELAMT 
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   5880
         TabIndex        =   51
         Top             =   1830
         Width           =   915
      End
      Begin VB.TextBox txtELBCA 
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   1890
         TabIndex        =   50
         Top             =   1830
         Width           =   915
      End
      Begin VB.ComboBox cboELPER 
         Height          =   315
         ItemData        =   "frmORD540.frx":00AB
         Left            =   5880
         List            =   "frmORD540.frx":00B8
         TabIndex        =   49
         Top             =   1350
         Width           =   1230
      End
      Begin VB.TextBox txtELPRC 
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   1905
         TabIndex        =   48
         Top             =   1350
         Width           =   915
      End
      Begin VB.TextBox txtELWGT 
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   5880
         TabIndex        =   47
         Top             =   930
         Width           =   915
      End
      Begin VB.TextBox txtELQTY 
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   1905
         TabIndex        =   46
         Top             =   855
         Width           =   915
      End
      Begin VB.TextBox txtELITN 
         Alignment       =   1  'Right Justify
         BeginProperty Font 
            Name            =   "VNI-Times"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   5895
         TabIndex        =   45
         Top             =   105
         Width           =   1425
      End
      Begin VB.TextBox txtELITD 
         BeginProperty Font 
            Name            =   "VNI-Times"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   7350
         Locked          =   -1  'True
         TabIndex        =   44
         Top             =   90
         Width           =   2550
      End
      Begin VB.TextBox txtELOLN 
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   1905
         Locked          =   -1  'True
         TabIndex        =   43
         Top             =   75
         Width           =   525
      End
      Begin VB.TextBox txtELPDC 
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   9375
         TabIndex        =   42
         Top             =   915
         Width           =   825
      End
      Begin VB.TextBox txtELBVA 
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   3075
         TabIndex        =   41
         Top             =   1830
         Width           =   960
      End
      Begin VB.TextBox txtELVAM 
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   7110
         TabIndex        =   40
         Top             =   1815
         Width           =   825
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Ware House code"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   255
         Index           =   33
         Left            =   4200
         TabIndex        =   84
         Top             =   510
         Width           =   1515
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Lot No"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   255
         Index           =   32
         Left            =   8715
         TabIndex        =   83
         Top             =   495
         Width           =   570
      End
      Begin VB.Line Line5 
         X1              =   7005
         X2              =   6885
         Y1              =   960
         Y2              =   1170
      End
      Begin VB.Line Line4 
         X1              =   3000
         X2              =   2880
         Y1              =   885
         Y2              =   1110
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "VAT %"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   255
         Index           =   26
         Left            =   8670
         TabIndex        =   75
         Top             =   1410
         Width           =   615
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Line status"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   240
         Index           =   23
         Left            =   8325
         TabIndex        =   62
         Top             =   1830
         Width           =   945
      End
      Begin VB.Label lbl 
         Alignment       =   2  'Center
         BackStyle       =   0  'Transparent
         Caption         =   "Base currency/VAT"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   255
         Index           =   22
         Left            =   45
         TabIndex        =   61
         Top             =   1875
         Width           =   1845
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Line amount/VAT"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   255
         Index           =   21
         Left            =   4215
         TabIndex        =   60
         Top             =   1875
         Width           =   1620
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Price Per"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   255
         Index           =   20
         Left            =   4950
         TabIndex        =   59
         Top             =   1410
         Width           =   855
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Unit price"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   255
         Index           =   19
         Left            =   975
         TabIndex        =   58
         Top             =   1395
         Width           =   870
      End
      Begin VB.Label lbl 
         Alignment       =   2  'Center
         BackStyle       =   0  'Transparent
         Caption         =   "Weight Cust. Order / Picked slip"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   405
         Index           =   18
         Left            =   4095
         TabIndex        =   57
         Top             =   870
         Width           =   1665
      End
      Begin VB.Label lbl 
         Alignment       =   2  'Center
         BackStyle       =   0  'Transparent
         Caption         =   "Quantity Cust. Order / Picked slip"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   390
         Index           =   17
         Left            =   60
         TabIndex        =   56
         Top             =   825
         Width           =   1785
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Item No"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   255
         Index           =   16
         Left            =   5010
         TabIndex        =   55
         Top             =   105
         Width           =   750
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Invoice lines"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   255
         Index           =   15
         Left            =   720
         TabIndex        =   54
         Top             =   135
         Width           =   1140
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Discount %"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   255
         Index           =   24
         Left            =   8250
         TabIndex        =   53
         Top             =   990
         Width           =   1065
      End
      Begin VB.Line Line2 
         X1              =   3000
         X2              =   2880
         Y1              =   1860
         Y2              =   2085
      End
      Begin VB.Line Line3 
         X1              =   7005
         X2              =   6885
         Y1              =   1860
         Y2              =   2070
      End
   End
   Begin MSAdodcLib.Adodc Adodc7 
      Height          =   375
      Left            =   3540
      Top             =   30
      Visible         =   0   'False
      Width           =   1740
      _ExtentX        =   3069
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "7 SMM"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSAdodcLib.Adodc Adodc6 
      Height          =   330
      Left            =   9390
      Top             =   -90
      Visible         =   0   'False
      Width           =   1830
      _ExtentX        =   3228
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "6 ECH"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.CommandButton cmdPrintConfirmed 
      Caption         =   "&Order Print Confirmed"
      Height          =   465
      Left            =   5340
      TabIndex        =   22
      Top             =   8055
      Width           =   1170
   End
   Begin VB.Frame FrameBB 
      BackColor       =   &H00800000&
      BorderStyle     =   0  'None
      Caption         =   "Frame2"
      Height          =   2535
      Left            =   135
      TabIndex        =   6
      Top             =   765
      Width           =   11400
      Begin VB.TextBox txtEHPTC 
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   9900
         TabIndex        =   76
         Top             =   1770
         Width           =   1170
      End
      Begin MSDataListLib.DataCombo cboEHCCD 
         Bindings        =   "frmORD540.frx":00D9
         Height          =   315
         Left            =   6420
         TabIndex        =   38
         Top             =   2130
         Visible         =   0   'False
         Width           =   1470
         _ExtentX        =   2593
         _ExtentY        =   556
         _Version        =   393216
         ListField       =   "CMCCD"
         BoundColumn     =   "CMCCD"
         Text            =   ""
      End
      Begin VB.TextBox txtEHCCD 
         Height          =   315
         Left            =   6420
         TabIndex        =   37
         Top             =   2130
         Width           =   1170
      End
      Begin MSDataListLib.DataCombo cboEHSNO 
         Bindings        =   "frmORD540.frx":00EE
         Height          =   315
         Left            =   6420
         TabIndex        =   36
         Top             =   885
         Visible         =   0   'False
         Width           =   3090
         _ExtentX        =   5450
         _ExtentY        =   556
         _Version        =   393216
         ListField       =   "MMNME"
         BoundColumn     =   "MMSNO"
         Text            =   ""
      End
      Begin VB.TextBox txtMMNME 
         BeginProperty Font 
            Name            =   "VNI-Helve"
            Size            =   9
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   7335
         TabIndex        =   35
         Top             =   900
         Width           =   2160
      End
      Begin VB.TextBox txtEHCPO 
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   6405
         TabIndex        =   34
         Top             =   1740
         Width           =   1170
      End
      Begin VB.TextBox txtEHNOL 
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   1665
         TabIndex        =   33
         Top             =   2160
         Width           =   480
      End
      Begin VB.TextBox txtEHSNO 
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   6420
         TabIndex        =   32
         Top             =   900
         Width           =   885
      End
      Begin VB.TextBox txtEHDUE 
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   1680
         TabIndex        =   31
         Top             =   1770
         Width           =   1215
      End
      Begin VB.TextBox txtEHSTA 
         BeginProperty Font 
            Name            =   "VNI-Helve"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   6420
         TabIndex        =   30
         Top             =   1335
         Width           =   3105
      End
      Begin VB.TextBox txtEHSTN 
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   1680
         TabIndex        =   29
         Top             =   1335
         Width           =   1215
      End
      Begin MSDataListLib.DataCombo cboEHCNO 
         Bindings        =   "frmORD540.frx":0103
         Height          =   315
         Left            =   1680
         TabIndex        =   21
         Top             =   900
         Visible         =   0   'False
         Width           =   3075
         _ExtentX        =   5424
         _ExtentY        =   556
         _Version        =   393216
         ListField       =   "CMNME"
         BoundColumn     =   "CMCNO"
         Text            =   ""
      End
      Begin VB.TextBox txtEHODN 
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   1680
         TabIndex        =   13
         Top             =   540
         Width           =   1215
      End
      Begin VB.TextBox txtEHDTE 
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   6435
         TabIndex        =   12
         Top             =   510
         Width           =   1170
      End
      Begin VB.TextBox txtEHCNO 
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   1680
         TabIndex        =   11
         Top             =   900
         Width           =   750
      End
      Begin VB.TextBox txtEHCER 
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   9915
         TabIndex        =   10
         Top             =   2115
         Width           =   1155
      End
      Begin VB.TextBox txtCMNME 
         BeginProperty Font 
            Name            =   "VNI-Helve"
            Size            =   9
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   288
         Left            =   2490
         TabIndex        =   9
         Top             =   900
         Width           =   2235
      End
      Begin VB.ComboBox cboEHSTT 
         ForeColor       =   &H000000FF&
         Height          =   315
         ItemData        =   "frmORD540.frx":0118
         Left            =   9810
         List            =   "frmORD540.frx":0131
         TabIndex        =   8
         Top             =   60
         Width           =   1350
      End
      Begin VB.ComboBox cboEHITP 
         Height          =   315
         ItemData        =   "frmORD540.frx":0184
         Left            =   4920
         List            =   "frmORD540.frx":018E
         TabIndex        =   7
         Top             =   30
         Width           =   1365
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Term code"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00E0E0E0&
         Height          =   255
         Index           =   28
         Left            =   8490
         TabIndex        =   77
         Top             =   1800
         Width           =   1320
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Number Of line"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00E0E0E0&
         Height          =   255
         Index           =   29
         Left            =   300
         TabIndex        =   28
         Top             =   2175
         Width           =   1320
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Customer PO No"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00E0E0E0&
         Height          =   255
         Index           =   27
         Left            =   4860
         TabIndex        =   27
         Top             =   1830
         Width           =   1470
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Payment due date"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00E0E0E0&
         Height          =   255
         Index           =   25
         Left            =   15
         TabIndex        =   26
         Top             =   1785
         Width           =   1590
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Saleman No"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00E0E0E0&
         Height          =   255
         Index           =   10
         Left            =   5220
         TabIndex        =   25
         Top             =   960
         Width           =   1110
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Ship to Address"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00E0E0E0&
         Height          =   255
         Index           =   8
         Left            =   4905
         TabIndex        =   24
         Top             =   1380
         Width           =   1425
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Ship to No"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00E0E0E0&
         Height          =   255
         Index           =   6
         Left            =   675
         TabIndex        =   23
         Top             =   1380
         Width           =   900
      End
      Begin VB.Line Line1 
         X1              =   2160
         X2              =   5340
         Y1              =   5280
         Y2              =   4455
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Order No"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00E0E0E0&
         Height          =   255
         Index           =   2
         Left            =   780
         TabIndex        =   20
         Top             =   555
         Width           =   840
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Customer Order Date"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00E0E0E0&
         Height          =   255
         Index           =   3
         Left            =   4470
         TabIndex        =   19
         Top             =   540
         Width           =   1920
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Order Type"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H0080FFFF&
         Height          =   255
         Index           =   4
         Left            =   3480
         TabIndex        =   18
         Top             =   105
         Width           =   1305
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Customer No"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00E0E0E0&
         Height          =   255
         Index           =   5
         Left            =   495
         TabIndex        =   17
         Top             =   975
         Width           =   1110
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Currency Code"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00E0E0E0&
         Height          =   255
         Index           =   7
         Left            =   5010
         TabIndex        =   16
         Top             =   2190
         Width           =   1320
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Exchange Rate"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00E0E0E0&
         Height          =   255
         Index           =   9
         Left            =   8490
         TabIndex        =   15
         Top             =   2145
         Width           =   1320
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Invoice status"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   255
         Index           =   13
         Left            =   8310
         TabIndex        =   14
         Top             =   120
         Width           =   1380
      End
   End
   Begin MSAdodcLib.Adodc Adodc5 
      Height          =   375
      Left            =   8610
      Top             =   -75
      Visible         =   0   'False
      Width           =   1605
      _ExtentX        =   2831
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "5 CUR_EX"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSAdodcLib.Adodc Adodc4 
      Height          =   360
      Left            =   8460
      Top             =   -75
      Visible         =   0   'False
      Width           =   1755
      _ExtentX        =   3096
      _ExtentY        =   635
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "4 INVOICE"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSAdodcLib.Adodc Adodc3 
      Height          =   345
      Left            =   9165
      Top             =   60
      Visible         =   0   'False
      Width           =   1725
      _ExtentX        =   3043
      _ExtentY        =   609
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "3 IIM"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSAdodcLib.Adodc Adodc2 
      Height          =   330
      Left            =   4740
      Top             =   15
      Visible         =   0   'False
      Width           =   1920
      _ExtentX        =   3387
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "2. AVM"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   6105
      Top             =   15
      Visible         =   0   'False
      Width           =   1935
      _ExtentX        =   3413
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "1 RCM"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.CommandButton cmdConfirmed 
      Caption         =   "Order line Confirmed"
      Height          =   465
      Left            =   4095
      TabIndex        =   5
      Top             =   8055
      Width           =   1200
   End
   Begin VB.CommandButton cmdPackedSlip 
      Caption         =   "Order line Packed Slip"
      Height          =   465
      Left            =   2805
      TabIndex        =   4
      Top             =   8055
      Width           =   1260
   End
   Begin VB.CommandButton cmdExit 
      Caption         =   "&Exit"
      Height          =   465
      Left            =   6570
      TabIndex        =   3
      Top             =   8055
      Width           =   1065
   End
   Begin VB.CommandButton cmdReview 
      Caption         =   "&Review Order"
      Height          =   465
      Left            =   1665
      TabIndex        =   2
      Top             =   8055
      Width           =   1092
   End
   Begin MSDataGridLib.DataGrid grdECL 
      Bindings        =   "frmORD540.frx":01B1
      Height          =   1785
      Left            =   135
      TabIndex        =   68
      Top             =   5880
      Width           =   11190
      _ExtentX        =   19738
      _ExtentY        =   3149
      _Version        =   393216
      BackColor       =   -2147483624
      ForeColor       =   8388608
      HeadLines       =   1
      RowHeight       =   19
      FormatLocked    =   -1  'True
      BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "VNI-Times"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ColumnCount     =   13
      BeginProperty Column00 
         DataField       =   ""
         Caption         =   ""
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1033
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column01 
         DataField       =   "ELOLN"
         Caption         =   "line"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1033
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column02 
         DataField       =   "ELITN"
         Caption         =   "Item"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1033
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column03 
         DataField       =   "ELITD"
         Caption         =   "Item Description"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1033
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column04 
         DataField       =   "ELQTY"
         Caption         =   "Quantity"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1033
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column05 
         DataField       =   "ELPSQ"
         Caption         =   "Packed QTY"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1036
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column06 
         DataField       =   "ELWGT"
         Caption         =   "Weight"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1033
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column07 
         DataField       =   "ELPSW"
         Caption         =   "Packed WGT"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1036
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column08 
         DataField       =   "ELPRC"
         Caption         =   "Unit price"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1033
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column09 
         DataField       =   "ELPER"
         Caption         =   "Price per"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1033
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column10 
         DataField       =   "ELAMT"
         Caption         =   "Line amount"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1033
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column11 
         DataField       =   "ELBCA"
         Caption         =   "Base Cur Amount"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1033
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column12 
         DataField       =   "ELSTT"
         Caption         =   "Status"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1033
            SubFormatType   =   0
         EndProperty
      EndProperty
      SplitCount      =   1
      BeginProperty Split0 
         BeginProperty Column00 
            ColumnWidth     =   14.74
         EndProperty
         BeginProperty Column01 
            ColumnWidth     =   329.953
         EndProperty
         BeginProperty Column02 
            ColumnWidth     =   1184.882
         EndProperty
         BeginProperty Column03 
            ColumnWidth     =   2670.236
         EndProperty
         BeginProperty Column04 
            ColumnWidth     =   720
         EndProperty
         BeginProperty Column05 
            ColumnWidth     =   1094.74
         EndProperty
         BeginProperty Column06 
            ColumnWidth     =   705.26
         EndProperty
         BeginProperty Column07 
            ColumnWidth     =   989.858
         EndProperty
         BeginProperty Column08 
            ColumnWidth     =   1094.74
         EndProperty
         BeginProperty Column09 
            ColumnWidth     =   959.811
         EndProperty
         BeginProperty Column10 
            ColumnWidth     =   959.811
         EndProperty
         BeginProperty Column11 
            ColumnWidth     =   840.189
         EndProperty
         BeginProperty Column12 
            ColumnWidth     =   1110.047
         EndProperty
      EndProperty
   End
   Begin VB.Label lbl 
      BackStyle       =   0  'Transparent
      Caption         =   "Invoice lines"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   7.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00E0E0E0&
      Height          =   255
      Index           =   14
      Left            =   30
      TabIndex        =   73
      Top             =   5595
      Width           =   1200
   End
   Begin VB.Label lbl 
      BackStyle       =   0  'Transparent
      Caption         =   "Base Amount"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   7.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00E0E0E0&
      Height          =   255
      Index           =   12
      Left            =   2985
      TabIndex        =   72
      Top             =   7710
      Width           =   1215
   End
   Begin VB.Label lbl 
      BackStyle       =   0  'Transparent
      Caption         =   "BaseVAT Amount"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   7.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00E0E0E0&
      Height          =   255
      Index           =   11
      Left            =   135
      TabIndex        =   71
      Top             =   7695
      Width           =   1590
   End
   Begin VB.Label lbl 
      BackStyle       =   0  'Transparent
      Caption         =   "VND VAT Amount"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   7.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00E0E0E0&
      Height          =   255
      Index           =   30
      Left            =   5850
      TabIndex        =   70
      Top             =   7725
      Width           =   1530
   End
   Begin VB.Label lbl 
      BackStyle       =   0  'Transparent
      Caption         =   "VND Amount"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   7.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00E0E0E0&
      Height          =   255
      Index           =   31
      Left            =   8655
      TabIndex        =   69
      Top             =   7740
      Width           =   1200
   End
   Begin VB.Label lbl 
      BackStyle       =   0  'Transparent
      Caption         =   "Order Confirmation"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   16.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00E0E0E0&
      Height          =   540
      Index           =   1
      Left            =   2535
      TabIndex        =   1
      Top             =   240
      Width           =   4470
   End
   Begin VB.Label lbl 
      BackStyle       =   0  'Transparent
      Caption         =   "ORD540"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   18
         Charset         =   0
         Weight          =   700
         Underline       =   -1  'True
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00E0E0E0&
      Height          =   450
      Index           =   0
      Left            =   105
      TabIndex        =   0
      Top             =   -45
      Width           =   1830
   End
End
Attribute VB_Name = "frmORD540"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Dim INVType(3), StaOrd(7), Per(3), OldEHODN As String, NewTrans As Byte, OldCurRate As Double
Private Sub cboEHCCD_Click(Area As Integer)
    If Area = 2 Then
        txtEHCCD = cboEHCCD.Text
        cboEHCCD.Visible = False
        Dim RecCCI As Recordset
        Set RecCCI = DBconn.Execute("Select * from CCI where CICCD='" & txtEHCCD & "' order by CIDTE DESC")
        If Not RecCCI.EOF Then
            txtEHCER = RecCCI!CICCR
        Else
            txtEHCER = 0
        End If
    End If
End Sub

Private Sub cboEHCNO_Click(Area As Integer)
    If Area = 2 Then
        txtEHCNO = cboEHCNO.BoundText
        txtCMNME = cboEHCNO.Text
        cboEHCNO.Visible = False
        txtEHSNO.SetFocus
    End If
End Sub


Private Sub cboEHITP_Click()
'    txtEHODN.SetFocus
End Sub

Private Sub cboEHSNO_Click(Area As Integer)
If Area = 2 Then
    txtEHSNO = cboEHSNO.BoundText
    txtMMNME = cboEHSNO.Text
    cboEHSNO.Visible = False
    txtEHSTN.SetFocus
End If
End Sub

Private Sub cboEHSTT_Click()
'MsgBox Left(cboEHSTT.List(cboEHSTT.ListIndex), 1)
End Sub

Private Sub cboELITN_Click(Area As Integer)
If Area = 2 Then
    txtELITN = cboELITN.BoundText
    txtELITD = cboELITN.Text
    cboELITN.Visible = False
    txtELQTY.SetFocus
End If
End Sub

Private Sub cboELLTN_Click(Area As Integer)
If Area = 2 Then
    txtELLTN = cboELLTN.Text
    cboELLTN.Visible = False

End If
End Sub

Private Sub cboELPER_Click()
Dim DiscAMT, DiscBAM
txtELVAT = VATRate(txtEHCNO, txtELITN)

Select Case cboELPER.ListIndex + 1
    Case 1
        txtELBVA = Val(txtELQTY) * Val(txtELPRC) * Val(txtELVAT)
        txtELBCA = (Val(txtELQTY) * Val(txtELPRC)) + Val(txtELBVA)
        DiscBAM = Val(txtELBCA) * Val(txtELPDC) / 100
        txtELBCA = Val(txtELBCA) - Val(DiscBAM)
        
        txtELVAM = Val(txtELQTY) * Val(txtELPRC) * Val(txtEHCER) * Val(txtELVAT)
        txtELAMT = Val(txtELQTY) * Val(txtELPRC) * Val(txtEHCER) + Val(txtELVAM)
        DiscAMT = Val(txtELAMT) * Val(DiscAMT) / 100
        txtELAMT = Val(txtELAMT) - Val(DiscAMT)
    Case 2
        txtELBVA = Val(txtELWGT) * Val(txtELPRC) * Val(txtELVAT)
        txtELBCA = (Val(txtELWGT) * Val(txtELPRC)) + Val(txtELBVA)
        DiscBAM = Val(txtELBCA) * Val(txtELPDC) / 100
        txtELBCA = Val(txtELBCA) - Val(DiscBAM)
        
        txtELVAM = Val(txtELWGT) * Val(txtELPRC) * Val(txtEHCER) * Val(txtELVAT)
        txtELAMT = Val(txtELWGT) * Val(txtELPRC) * Val(txtEHCER) + Val(txtELVAM)
        DiscAMT = Val(txtELAMT) * Val(DiscAMT) / 100
        txtELAMT = Val(txtELAMT) - Val(DiscAMT)
End Select
'txtELPDC.SetFocus
End Sub

Private Sub cboELWHC_Click(Area As Integer)
If Area = 2 Then
    txtELWHC = cboELWHC.BoundText
    txtWMDSC = cboELWHC.Text
    cboELWHC.Visible = False
    Dim Havelot As Byte
    Havelot = False
    If Find("IIM", "IMLOT", " WHERE IMITN='" & txtELITN & "'") Then Havelot = True
    If Havelot Then
        txtELLTN.SetFocus
    Else
'        txtELQTY.SetFocus
    End If
   ' txtTHTTC.SetFocus

End If
End Sub

Private Sub cmdConfirmed_Click()
Dim txtELBOD As String
If Not ValidInput() Then Exit Sub
'Truong hop da in hay confirm
If cboEHSTT.ListIndex + 1 = 2 Or cboEHSTT.ListIndex + 1 = 3 Then 'Package Print Or Comfirmed
    txtELPSQ = IIf(IsNumeric(txtELPSQ), txtELPSQ, 0)
    txtELPSW = IIf(IsNumeric(txtELPSW), txtELPSW, 0)
    If Val(txtELPSQ) > 0 And Val(txtELPSW) > 0 Then
        txtELBOQ = Val(txtELQTY) - Val(txtELPSQ)
        txtELBOW = Val(txtELWGT) - Val(txtELPSW)
        txtELBOD = IIf(chkELBOD.value = 1, "Y", "")
        SQL = "Update  ECL set ELPSQ=" & txtELPSQ & ",ELPSW=" & txtELPSW & _
        ",ELWHC='" & txtELWHC & "',ELLTN='" & txtELLTN & "',ELSTT='3' where ELODN='" & txtEHODN & "' " & _
        " AND ELOLN=" & txtELOLN
        DBconn.Execute SQL
        WriteToIIM txtELITN, -Val(txtELBOW), -Val(txtELBOQ)
        SQL = "Update ECH set EHSTT='3'  where EHODN='" & txtEHODN & "' " & _
            " AND (EHSTT='2')"
            DBconn.Execute SQL
               
        If chkELBOD.value = 1 And Val(txtELBOQ) > 0 Then 'Back Order
            SQL = "Update ECL set ELQTY=" & txtELPSQ & _
                ",ELWGT=" & txtELPSW & ",ELSTT='3',ELBOD='" & txtELBOD & "'" & _
                " where ELODN='" & txtEHODN & "' AND ELOLN=" & txtELOLN
            'MsgBox SQL
            DBconn.Execute SQL
        
            Set recECL = DBconn.Execute("Select * from ECL where ELODN='" & txtEHODN & "' order by ELOLN Desc ")
            If recECL.EOF Then
                txtELOLN = 1
            Else
                txtELOLN = recECL!ELOLN + 1
            End If
            SQL = "Insert into ECL(ELODN,ELITN,ELITD,ELLUS" & _
            ",ELPER,ELOLN,ELSTT " & _
            ",ELQTY,ELWGT,ELPSQ,ELPSW,ELPRC,ELPDC" & _
            ",ELAMT,ELVAM,ELBCA,ELBVA,ELVAT) values " & _
            "('" & txtEHODN & "','" & txtELITN & "','" & txtELITD & "','" & UserLogin & "'" & _
            ",'" & cboELPER.ListIndex + 1 & "','" & txtELOLN & "','4'" & _
            "," & txtELBOQ & "," & txtELBOW & ",0,0," & txtELPRC & "," & txtELPDC & _
            "," & txtELAMT & "," & txtELVAM & "," & txtELBCA & "," & txtELBVA & "," & txtELVAT & ")"
            
            'MsgBox SQL
            DBconn.Execute (SQL)
            WriteToIIM txtELITN, Val(txtELBOW), Val(txtELBOQ)
            
        End If
        WriteToScreen
         If SELECTROW = "" Then SELECTROW = 1
        Adodc4.Recordset.AbsolutePosition = SELECTROW
    Else
        MsgBox "Packed Quantity and Packed Weight must be >0"
    End If
End If

End Sub

Private Sub cmdExit_Click()
Unload frmORD540
End Sub

Private Sub cmdPackedSlip_Click()
On Error GoTo ord540_err
Adodc4.Recordset.AbsolutePosition = SELECTROW

CrystalReport1.ReportFileName = DDAN & "\ORD250.rpt"
CrystalReport1.RetrieveStoredProcParams
CrystalReport1.StoredProcParam(0) = txtEHODN
CrystalReport1.StoredProcParam(1) = "1"
CrystalReport1.Destination = crptToWindow
CrystalReport1.Action = 1
SQL = "Update ECH set EHSTT='2'  where EHODN='" & txtEHODN & "' " & _
" AND (EHSTT='B' OR EHSTT='4')"
DBconn.Execute SQL
SQL = "Update  ECL set ELSTT='2' where ELODN='" & txtEHODN & "' " & _
" AND (ELSTT='B' OR ELSTT='4')"
DBconn.Execute SQL
WriteToScreen
 If SELECTROW = "" Then SELECTROW = 1
ord540_next:
    Exit Sub
ord540_err:
    MsgBox "ORD540_Packingslip Printing" & Err.Description
    Resume ord540_next
End Sub



Private Sub cmdPrintConfirmed_Click()
    CrystalReport1.ReportFileName = DDAN & "\ORD260.rpt"
    CrystalReport1.RetrieveStoredProcParams
    CrystalReport1.StoredProcParam(0) = txtEHODN
    CrystalReport1.StoredProcParam(1) = "2"
    CrystalReport1.Destination = crptToWindow
    CrystalReport1.Action = 1
End Sub

Private Sub cmdReview_Click()
    frmReview.Tag = "ORD540"
    frmReview.Show 1
    ISEDITING = False
    ISADDING = False
    If frmReview.Tag <> "" Then
        txtEHODN = frmReview.Tag
        txtELOLN = 1
        WriteToScreen
    End If
End Sub
Sub WriteToScreen()
Dim recECL As Recordset
cboELITN.Visible = False
cboELWHC.Visible = False
cboELLTN.Visible = False

Set recECL = DBconn.Execute("Select ECH.* from ECH where ECH.EHODN='" & txtEHODN & "'")
If Not recECL.EOF Then
    With recECL
       For i = 0 To cboEHITP.ListCount - 1
            If Left(cboEHITP.List(i), 1) = !EHITP Then
                cboEHITP.ListIndex = i
                Exit For
            End If
        Next i
        txtEHNOL = IIf(IsNull(!EHNOL), 0, !EHNOL)
        txtEHODN = !EHODN
        OldEHODN = txtEHODN
        txtEHDTE = !EHDTE
        txtEHCNO = !EHCNO
        txtEHSTN = !EHSTN
        txtEHSTA = !EHSTA
        txtCMNME = Find("RCM", "CMNME", " WHERE CMCNO='" & txtEHCNO & "'")
        txtEHCPO = IIf(IsNull(!EHCPO), 0, !EHCPO)
        txtEHPTC = IIf(IsNull(!EHPTC), "", !EHPTC)
        For i = 0 To cboEHSTT.ListCount - 1
            If Left(cboEHSTT.List(i), 1) = !EHSTT Then
                cboEHSTT.ListIndex = i
                Exit For
            End If
        Next i
        cboEHCCD = !EHCCD
        txtEHCER = !EHCER
        OldCurRate = txtEHCER
        txtEHCCD = !EHCCD
        txtEHSNO = !EHSNO
        txtMMNME = Find("SMM", "MMNME", " WHERE MMSNO='" & txtEHSNO & "'")
        txtEHDUE = !EHDUE
        txtEHAMT = !EHAMT
        txtEHVAM = !EHVAM
        txtEHBCA = !EHBAM
        txtEHBVA = !EHBVA

        .Close
    End With
End If

If txtELOLN <> "" Then
    Set recECL = DBconn.Execute("Select ECL.* from ECL where ECL.ELODN='" & txtEHODN & "' and ELOLN='" & txtELOLN & "'")
    If Not recECL.EOF Then
        With recECL
            txtELITN = !ELITN
            txtELITD = !ELITD
             txtELWHC = IIf(IsNull(!ELWHC), "", !ELWHC)
            txtWMDSC = Find("IWM", "WMDSC", " WHERE WMWHC='" & txtELWHC & "'")
            txtELLTN = IIf(IsNull(!ELLTN), "", !ELLTN)
            txtELOLN = !ELOLN
            txtELQTY = !ELQTY
            txtELPSQ = IIf(IsNull(!ELPSQ), 0, !ELPSQ)
            txtELWGT = !ELWGT
            txtELPSW = IIf(IsNull(!ELPSW), 0, !ELPSW)
            txtELPRC = !ELPRC
            For i = 0 To cboELPER.ListCount - 1
                If Left(cboELPER.List(i), 1) = !ELPER Then
                    cboELPER.ListIndex = i
                    Exit For
                End If
            Next i
            txtELPDC = !ELPDC
            txtELAMT = !ELAMT ' Line amount
            txtELVAM = !ELVAM ' VAT line (VND)
            txtELBCA = !ELBCA ' Base currency line amount
            txtELBVA = !ELBVA ' VAT base currency
            txtELVAT = !ELVAT
            For i = 0 To cboELSTT.ListCount - 1
                If Left(cboELSTT.List(i), 1) = !ELSTT Then
                    cboELSTT.ListIndex = i
                    Exit For
                End If
            Next i
            txtELBOD = IIf(IsNull(!ELBOD), "", !ELBOD)
            chkELBOD = IIf(txtELBOD = "Y", 1, 0)
            .Close
        End With
     End If
End If


Adodc4.RecordSource = "Select ECL.*,ECH.* from ECL " & _
    " LEFT JOIN ECH ON ECL.ELODN=ECH.EHODN where ECH.EHODN ='" & txtEHODN & "' ORDER BY ELOLN"
Adodc4.Refresh

    txtELPSQ.Locked = (Left(cboELSTT.List(i), 1) = "6")
    txtELPSW.Locked = (Left(cboELSTT.List(i), 1) = "6")
    txtELWHC.Locked = (Left(cboELSTT.List(i), 1) = "6")
    txtELLTN.Locked = (Left(cboELSTT.List(i), 1) = "6")
    chkELBOD.Enabled = Not (Left(cboELSTT.List(i), 1) = "6")



End Sub

Private Sub Form_Load()
    NewTrans = False
    ISEDITING = False
    ISADDING = False
    OpenFile
    ButtonStatus
End Sub

Private Sub grdECL_Click()
    If Adodc4.Recordset.RecordCount = 0 Then
        Exit Sub
    End If
    txtELOLN = grdECL.Columns(1).value

    WriteToScreen
    If SELECTROW = "" Then SELECTROW = 1
    Adodc4.Recordset.AbsolutePosition = SELECTROW
End Sub



Private Sub grdECL_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
SELECTROW = Adodc4.Recordset.Bookmark
End Sub

Private Sub txtEHCCD_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    Dim Result As String
    Result = Find("CCM", "CMCCD", "WHERE CMCCD='" & txtEHCCD & "'")
    If Result <> "" Then
        Dim RecCCI As Recordset
        Set RecCCI = DBconn.Execute("Select * from CCI where CICCD='" & txtEHCCD & "' order by CIDTE DESC")
        If Not RecCCI.EOF Then
            txtEHCER = RecCCI!CICCR
        Else
            txtEHCER = 0
        End If
        txtEHCER.SetFocus
    Else
        cboEHCCD.Visible = True
        cboEHCCD.SetFocus
    End If
End If
End Sub

Private Sub txtEHCER_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then txtELITN.SetFocus
End Sub

Private Sub txtEHCNO_KeyPress(KeyAscii As Integer)
Dim Result As String
If KeyAscii = 13 Then
    Result = Find("RCM", "CMNME", "WHERE CMCNO='" & txtEHCNO & "'")
    If Result = "" Then
        cboEHCNO.Visible = True
        cboEHCNO.SetFocus
    Else
        cboEHCNO.Visible = False
        txtCMNME = Result
        txtEHSNO.SetFocus
    End If
End If
End Sub

Private Sub txtEHCPO_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then txtEHCCD.SetFocus
End Sub

Private Sub txtEHDTE_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then txtEHCNO.SetFocus
End Sub

Private Sub txtEHDUE_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then txtEHCPO.SetFocus
End Sub

Private Sub txtEHODN_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    Result = Find("ECH", "EHODN", "WHERE EHODN='" & txtEHODN & "'")
    If Result = "" Then
       txtEHDTE.SetFocus
    Else
        MsgBox "Order Number is already exist"
        txtEHODN.SetFocus
        Exit Sub
    End If
End If
End Sub

Private Sub txtEHSNO_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then
    Dim Result As String
    Result = Find("SMM", "MMNME", "WHERE MMSNO='" & txtEHSNO & "'")
    If Result = "" Then
        cboEHSNO.Visible = True
        cboEHSNO.SetFocus
    Else
        cboEHSNO.Visible = False
        txtMMNME = Result
        txtEHSTN.SetFocus
    End If
End If

End Sub

Private Sub txtEHSTA_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then txtEHDUE.SetFocus
End Sub

Private Sub txtEHSTN_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then txtEHSTA.SetFocus
End Sub

Private Sub txtELAMT_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then txtELVAM.SetFocus
End Sub

Private Sub txtELBCA_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then txtELBVA.SetFocus
End Sub

Private Sub txtELBVA_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then txtELAMT.SetFocus
End Sub

Private Sub txtELITN_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    Dim Result As String
    Result = Find("IIM", "IMITD", "WHERE IMITN='" & txtELITN & "'")
    If Result = "" Then
        cboELITN.Visible = True
        cboELITN.SetFocus
    Else
        txtELITD = Result
        cboELITN.Visible = False
        txtELQTY.SetFocus
    End If
   
End If
End Sub
Sub OpenFile()
Adodc1.ConnectionString = ConnectString
Adodc1.ConnectionTimeout = 10
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "Select * from RCM"
Adodc1.Refresh

Adodc2.ConnectionString = ConnectString
Adodc2.ConnectionTimeout = 10
Adodc2.CommandType = adCmdText
Adodc2.RecordSource = "Select * from AVM"
Adodc2.Refresh

FieldDel = "IMRID"
DelStatus = "IZ"
SQL = "Select * from IIM where " & FieldDel & " <>'" & DelStatus & "' "
Adodc3.ConnectionString = ConnectString
Adodc3.ConnectionTimeout = 10
Adodc3.CommandType = adCmdText
Adodc3.RecordSource = SQL
Adodc3.Refresh

Adodc4.ConnectionString = ConnectString
Adodc4.ConnectionTimeout = 10
Adodc4.CommandType = adCmdText
Adodc4.RecordSource = "Select ECL.*,ECH.* from ECL " & _
    " LEFT JOIN ECH ON ECL.ELODN=ECH.EHODN where ECH.EHODN ='" & txtEHODN & "' and ELSTT<>'7' ORDER BY ELOLN"
Adodc4.Refresh

Adodc5.ConnectionString = ConnectString
Adodc5.ConnectionTimeout = 10
Adodc5.CommandType = adCmdText
Adodc5.RecordSource = "Select * from CCM"
Adodc5.Refresh

Adodc6.ConnectionString = ConnectString
Adodc6.ConnectionTimeout = 10
Adodc6.CommandType = adCmdText
Adodc6.RecordSource = "Select * from ECH"
Adodc6.Refresh

Adodc7.ConnectionString = ConnectString
Adodc7.ConnectionTimeout = 10
Adodc7.CommandType = adCmdText
Adodc7.RecordSource = "Select * from SMM"
Adodc7.Refresh

Adodc8.ConnectionString = ConnectString
Adodc8.ConnectionTimeout = 10
Adodc8.CommandType = adCmdText
Adodc8.RecordSource = "Select * from IWM"
Adodc8.Refresh
' Create array from combobox Custtype,StatusOrder, ValuePer
INVType(1) = "1 Normal"
INVType(2) = "2 By pass Inventory"

StaOrd(1) = "1 New"
StaOrd(2) = "2 Printed"
StaOrd(3) = "3 Confirmed"
StaOrd(4) = "4 B/O"
StaOrd(5) = "5 Caredit hold"
StaOrd(6) = "6 Completed"
StaOrd(7) = "7 Canceled"
Per(1) = "Unt"
Per(2) = "Wgt"
Per(3) = "All"
End Sub

Sub ButtonStatus()
'cmdAddNew.Enabled = Not ISEDITING
'cmdReview.Enabled = Not ISEDITING
'cmdNewItem.Enabled = Not ISEDITING
'cmdEdit.Enabled = Not ISEDITING
'cmdSave.Enabled = ISEDITING
'cmdCancel.Enabled = ISEDITING
FrameBB.Enabled = ISEDITING 'NewTrans
FrameECLine.Enabled = ISEDITING
'txtEHODN.Locked = Not ISADDING
End Sub

Sub WriteToFile()
Dim recECL As Recordset
txtELLDT = Format(Now(), "yyyy-mm-dd hh:mm:ss")
If ISADDING Then
    If txtELITN <> "" Then
        Set recECL = DBconn.Execute("Select * from ECL where ELODN='" & txtEHODN & "' order by ELOLN Desc ")
        If recECL.EOF Then
            txtELOLN = 1
        Else
            txtELOLN = recECL!ELOLN + 1
        End If
        SQL = "Insert into ECL(ELODN,ELITN,ELITD,ELWHC,ELLTN,ELLUS" & _
        ",ELPER,ELOLN,ELSTT " & _
        ",ELQTY,ELWGT,ELPRC,ELPDC" & _
        ",ELAMT,ELVAM,ELBCA,ELBVA,ELVAT) values " & _
        "('" & txtEHODN & "','" & txtELITN & "','" & txtELITD & "','" & txtELWHC & "','" & txtELLTN & "','" & UserLogin & "'" & _
        ",'" & cboELPER.ListIndex + 1 & "','" & txtELOLN & "','1'" & _
        "," & txtELQTY & "," & txtELWGT & "," & txtELPRC & "," & txtELPDC & _
        "," & txtELAMT & "," & txtELVAM & "," & txtELBCA & "," & txtELBVA & "," & txtELVAT & ")"
        
        'MsgBox SQL
        DBconn.Execute (SQL)
        WriteToIIM txtELITN, Val(txtELWGT), Val(txtELQTY)
    End If
Else
    txtEHLDT = Format(Now(), "yyyy-mm-dd hh:mm:ss")
    txtEHDTE = Format(txtEHDTE, "yyyy-mm-dd hh:mm:ss")
    txtEHDUE = Format(txtEHDUE, "yyyy-mm-dd hh:mm:ss")
    If Left(cboEHSTT.List(cboEHSTT.ListIndex), 1) = "7" Then 'Cancel
        
        Set recECL = DBconn.Execute("Select * from ECL where ELODN='" & txtEHODN & "' AND ELSTT<>'7'")
        With recECL
            Do While Not recECL.EOF
                WGT = -(!ELWGT)
                Unt = -(!ELQTY)
                WriteToIIM !ELITN, WGT, Unt
                recECL.MoveNext
            Loop
        End With
        SQL = "Update ECL  set ELSTT='7' where ELODN='" & txtEHODN & "'"
        DBconn.Execute SQL
    Else
        Set recECL = DBconn.Execute("Select * from ECL where ELODN='" & txtEHODN & "' and ELOLN='" & txtELOLN & "'")
        With recECL
            If Left(cboELSTT.List(cboELSTT.ListIndex), 1) = "7" Then  'Cancel
                Unt = -(!ELQTY)
                WGT = -(!ELWGT)
            Else
                Unt = Val(txtELQTY) - !ELQTY
                WGT = Val(txtELWGT) - !ELWGT
            End If
        End With
        WriteToIIM txtELITN, WGT, Unt
    End If
    SQL = "Update ECL set ELLDT='" & txtELLDT & "',ELITN='" & txtELITN & "',ELITD='" & txtELITD & "'" & _
    ",ELWHC='" & txtELWHC & "',ELLTN='" & txtELLTN & "',ELLUS='" & UserLogin & "'" & _
    ",ELPER='" & cboELPER.ListIndex + 1 & "',ELOLN='" & txtELOLN & "',ELSTT='" & cboELSTT.ListIndex + 1 & "'" & _
    ",ELQTY=" & txtELQTY & ",ELWGT=" & txtELWGT & ",ELPRC=" & txtELPRC & ",ELPDC=" & txtELPDC & _
    ",ELAMT=" & txtELAMT & ",ELVAM=" & txtELVAM & ",ELBCA=" & txtELBCA & ",ELBVA=" & txtELBVA & ",ELVAT=" & txtELBVA & _
    " where ELODN='" & OldEHODN & "' AND ELOLN='" & txtELOLN & "'"
    DBconn.Execute SQL
    
    
    SQL = "Update ECH set EHLDT='" & txtEHLDT & "',EHDTE='" & txtEHDTE & "',EHITP='" & cboEHITP.ListIndex + 1 & "'" & _
    ",EHODN='" & txtEHODN & "',EHCNO='" & txtEHCNO & "',EHSTN='" & txtEHSTN & "',EHPTC='" & txtEHPTC & "'" & _
    ",EHSTA='" & txtEHSTA & "',EHSNO='" & txtEHSNO & "',EHDUE='" & txtEHDUE & "',EHCPO='" & txtEHCPO & "'" & _
    ",EHCCD='" & txtEHCCD & "',EHCER=" & txtEHCER & " where EHODN='" & OldEHODN & "'"
    DBconn.Execute SQL
End If
Dim RecCountLine As Recordset
Set RecCountLine = DBconn.Execute("SELECT ELODN, COUNT(ELOLN) AS CountLine From ECL " & _
" WHERE (ELODN = '" & txtEHODN & "') AND (ELSTT <> N'7')GROUP BY ELODN")
txtEHNOL = RecCountLine!CountLine
RecCountLine.Close
If NewTrans Then
    txtEHLDT = Format(Now(), "yyyy-mm-dd hh:mm:ss")
    txtEHDTE = Format(WorkingDate, "yyyy-mm-dd hh:mm:ss")
    txtEHDUE = Format(txtEHDUE, "yyyy-mm-dd hh:mm:ss")
    
    SQL = "Insert into ECH (EHLDT,EHDTE,EHITP" & _
    ",EHODN,EHCNO,EHSTN,EHPTC" & _
    ",EHSTA,EHSNO,EHDUE,EHCPO" & _
    ",EHCCD,EHCER,EHNOL,EHSTT) values " & _
    "('" & txtEHLDT & "','" & txtEHDTE & "','" & cboEHITP.ListIndex + 1 & "'" & _
    ",'" & txtEHODN & "','" & txtEHCNO & "','" & txtEHSTN & "','" & txtEHPTC & "'" & _
    ",'" & txtEHSTA & "','" & txtEHSNO & "','" & txtEHDUE & "','" & txtEHCPO & "'" & _
    ",'" & txtEHCCD & "'," & txtEHCER & "," & txtEHNOL & ",'1')"
    MsgBox SQL
    DBconn.Execute (SQL)

End If

recECL.Close
Set recECL = DBconn.Execute("SELECT ELODN, SUM(ELVAM) AS SumELVAM, SUM(ELAMT)" & _
    " AS SumELAMT, SUM(ELBVA) AS SumELBVA, SUM(ELBCA) " & _
    " AS SumELBCA FROM ECL WHERE (ELODN = '" & txtEHODN & "') GROUP BY ELODN")
With recECL
    txtEHAMT = !SumELAMT
    txtEHVAM = !SumELVAM
    txtEHBAM = !SumELBCA
    txtEHBVA = !SumELBVA
End With
recECL.Close

DBconn.Execute ("UPDATE ECH SET EHAMT=" & txtEHAMT & ",EHVAM=" & txtEHVAM & ",EHBAM=" & txtEHBAM & ",EHBVA=" & txtEHBVA & " WHERE EHODN='" & txtEHODN & "'")

Adodc4.RecordSource = "Select ECL.*,ECH.* from ECL " & _
    " LEFT JOIN ECH ON ECL.ELODN=ECH.EHODN where ECH.EHODN ='" & txtEHODN & "' ORDER BY ELOLN"
Adodc4.Refresh

End Sub

Sub WriteToIIM(ITN, WGT, unit)

unit = IIf(IsNumeric(unit), unit, 0)
 WGT = IIf(IsNumeric(WGT), WGT, 0)
    

SQL = "UPDATE IIM SET IMCOW=IMCOW+" & WGT & ",IMCOU=IMCOU+" & unit & " WHERE IMITN='" & ITN & "'"
DBconn.Execute SQL

End Sub


Private Sub txtELLTN_GotFocus()
Dim Result
Dim Havelot As Byte
Havelot = False
If Find("IIM", "IMLOT", " WHERE IMITN='" & txtELITN & "'") Then Havelot = True
If Havelot Then
        If txtELITN <> "" And txtELWHC <> "" Then
             Result = Find("ILI", "ILLOT", " WHERE  ILITN='" & txtELITN & "' AND  ILWHC='" & txtELWHC & "'")
             If Result <> "" Then
                     Adodc9.ConnectionString = ConnectString
                     Adodc9.ConnectionTimeout = 10
                     Adodc9.CommandType = adCmdText
                     Adodc9.RecordSource = "Select * from ILI WHERE ILITN='" & txtELITN & "' AND  ILWHC='" & txtELWHC & "'"
                     Adodc9.Refresh
             Else
                     Response = MsgBox("There are no lot of this Item in this Warehouse.Do you want to add new lot?", vbYesNo + vbCritical + vbDefaultButton2, "Chu y'")
                     If Response = vbYes Then
                         frmINV120.Show 1
                     Else
                         MsgBox "Please select another Warehouse!"
                         txtELWHC.SetFocus
                     End If
            End If
        Else
            MsgBox "Please select an Item and Warehouse fisrt!"
        End If
Else
    MsgBox "This Item have no lot"
    txtELPSQ.SetFocus
End If
End Sub

Private Sub txtELLTN_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
     Result = Find("ILI", "ILLOT", " WHERE  ILITN='" & txtELITN & "' AND  ILWHC='" & txtELWHC & "' AND ILLOT='" & txtELLTN & "'")
    If Result = "" Then
        cboELLTN.Visible = True
        cboELLTN.SetFocus
    Else
        txtELQTY.SetFocus
    End If
End If
End Sub

Private Sub txtELPDC_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then txtELVAT.SetFocus
End Sub

Private Sub txtELPRC_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then cboELPER.SetFocus
End Sub

Private Sub txtELQTY_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then txtELWGT.SetFocus
End Sub

Private Sub txtELVAM_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then cmdSave.SetFocus
End Sub

Private Sub txtELVAT_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then txtELBCA.SetFocus
End Sub

Private Sub txtELWGT_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then txtELPRC.SetFocus

End Sub
Sub tam()
If Left(cboEHSTT.List(cboEHSTT.ListIndex), 1) = "7" Then 'Cancel
        SQL = "Update ECL  set ELSTT='7' where ELODN='" & txtEHODN & "'"
        DBconn.Execute SQL
        
        Set recECL = DBconn.Execute("Select * from ECL where ELODN='" & txtEHODN & "'")
        With recECL
            Do While Not recECL.EOF
                WGT = -(!ELWGT)
                Unt = -(!ELQTY)
                WriteToIIM !ELITN, WGT, Unt
                recECL.MoveNext
            Loop
        End With
    Else
        Set recECL = DBconn.Execute("Select * from ECL where ELODN='" & txtEHODN & "' and ELOLN='" & txtELOLN & "'")
        With recECL
            If Left(cboELSTT.List(cboELSTT.ListIndex), 1) = "7" Then  'Cancel
                Unt = -(recECL!ELQTY)
                WGT = -(recECL!ELWGT)
            Else
                Unt = recECL!ELQTY - Val(txtELQTY)
                WGT = recECL!ELWGT - Val(txtELWGT)
            End If
        End With
        WriteToIIM txtELITN, WGT, Unt
    End If
End Sub

Function ValidInput()
Dim Result
Dim StrErr As String, Havelot As Byte
Havelot = False
If Find("IIM", "IMLOT", " WHERE IMITN='" & txtELITN & "'") Then Havelot = True
If Find("IIM", "IMITN", " WHERE IMITN='" & txtELITN & "'") Then
    If Find("IWM", "WMWHC", " WHERE WMWHC='" & txtELWHC & "'") <> "" Then
        If Havelot Then
            If Find("ILI", "ILLOT", " WHERE  ILITN='" & txtELITN & "' AND  ILWHC='" & txtELWHC & "'") = "" Then
                StrErr = StrErr & Chr(13) & "* Can't find this Lot  of  this Item in this Warehouse"
            End If
        End If
    Else
        StrErr = StrErr & Chr(13) & "* Can't find this Warehouse"
    End If
Else
     StrErr = StrErr & Chr(13) & "* Can't find this Item"
End If
If txtELQTY = 0 Then StrErr = StrErr & Chr(13) & "* Quantity must be >0"
If txtELWGT = 0 Then StrErr = StrErr & Chr(13) & "* Weight must be >0"
If StrErr <> "" Then
    MsgBox "Please check again!" & StrErr
    ValidInput = False
Else
    ValidInput = True
End If
End Function
Private Sub txtELWHC_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    Dim Result As String
    Result = Find("IWM", "WMDSC", "WHERE WMWHC='" & txtELWHC & "'")
    If Result = "" Then
            cboELWHC.Visible = True
            cboELWHC.SetFocus
    Else
            txtWMDSC = Result
            cboELWHC.Visible = False
            Dim Havelot As Byte
            Havelot = False
            If Find("IIM", "IMLOT", " WHERE IMITN='" & txtELITN & "'") Then Havelot = True
            If Havelot Then
                 txtELLTN.SetFocus
            Else
'                 txtELWGT.SetFocus
            End If
    End If
End If
End Sub
